<!-- 用户协议弹窗 -->
<template>
  <view class="protocol-popup">
    <van-popup 
		:show="showPopup" 
		position="center" 
		z-index="1000"
		custom-style="width:290px;height:405px;background:transparent;overflow: inherit;"
	>
	 <view class="cross-icon" @click="closeFunction()">
		 <image
		  src="../../static/images/icon/icon_close_white.png"
		   mode="heightFix"
		 ></image>
	 </view>
	  <view class="swipers">
		 <swiper class="swiper-container" autoplay :interval="3000" circular layout-type="stackLeft">
		 	<swiper-item v-for="(item,index) in list" :key="index" @click="emit('advertiseClick','/pages/information/webpage?url='+item.linkUrl)">
		 		<view class="bg-cover swiper-image" :style="{'backgroundImage': 'url('+item.picture+')'}"></view>
		 	</swiper-item>
		 </swiper>
	  </view>
    </van-popup>
  </view>
</template>

<script setup>
const props = defineProps({
  showPopup: {
    type: Boolean,
    default: true,
  },
  list: {
	  type: Array,
	  default: []
  }
});

const emit = defineEmits(["update:showPopup",'advertiseClick']);
function closeFunction() {
   emit("update:showPopup", false);
   uni.setStorageSync('advertise',true)
   
}
</script>

<style lang="scss" scoped>
.protocol-popup {
  font-size: 26rpx;
  text-align: center;
  line-height: 32rpx;
  .cross-icon {
	  position: absolute;
	  top: -136rpx;
	  right: 0;
	  image {
		  width: 40rpx;
		  height: 40rpx;
	  }
  }
  .swipers {
	  height: 100%;
	  width: 100%;
	  .swiper-container {
	  	height: 100%;
	  	.swiper-image {
	  		height: 100%;
	  	}
	  }
  }
  
}
</style>
